{% extends "projects/project_edit_base.html" %}

{% load i18n %}
{% load gravatar %}

{% block title %}{% trans "Edit Maintainers" %}{% endblock %}

{% block project-users-active %}active{% endblock %}
{% block project_edit_content_header %}{% trans "Maintainers" %}{% endblock %}

{% block project_edit_content %}
  <p class="help_text">
    {% trans "This allows you to add maintainers to your project. It gives them admin access to the project, so be careful!" %}
  </p>

  <div class="module">
    <div class="module-list">
      <div class="module-list-wrapper">
        <ul>
          {% for user in users %}
            <li class="module-item">
              <span>
                {% gravatar user.email 24 %}
                <a href="{% url "profiles_profile_detail" user.username %}">
                  {{ user.get_full_name|default:user.username }}
                </a>
              </span>
              <ul class="module-item-menu">
                <li>
                  {% if not is_last_user %}
                  <form method="post" action="{% url "projects_users_delete" project.slug %}">
                    {% csrf_token %}
                    <input type="hidden" name="username" value="{{ user.username }}" />
                    <input type="submit" value="{% trans "Remove" %}">
                  </form>
                  {% endif %}
                </li>
              </ul>
            </li>
          {% endfor %}

          {% include "invitations/includes/invitation_list.html" with invitations=invitations %}
        </ul>
      </div>
    </div>
  </div>

  <div>
    <h3>{% trans "Add maintainer" %}</h3>
    <form method="post" action=".">
      {% csrf_token %}
      {{ form.as_p }}
      <input type="submit" value="{% trans "Add" %}">
    </form>
  </div>
{% endblock %}
